From 46145d96ec4b7cb0611715efb0bbc3c205be5076 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Thu, 13 Mar 2003 21:33:05 +0000 Subject: [PATCH] bitkeeper revision 1.122.1.13 (3e70f911KaQqE5hysMl8FEBceVLlvA) smpboot.h, io_apic.c: Round robin allocate IRQs to processors on SMP. --- xen/arch/i386/io_apic.c | 2 -- xen/include/asm-i386/smpboot.h | 11 ++++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/xen/arch/i386/io_apic.c b/xen/arch/i386/io_apic.c index 878c189afb..6ad37f2399 100644 --- a/xen/arch/i386/io_apic.c +++ b/xen/arch/i386/io_apic.c @@ -826,7 +826,6 @@ void __init print_IO_APIC(void) UNEXPECTED_IO_APIC(); } -#if 0 printk(KERN_DEBUG ".... IRQ redirection table:\n"); printk(KERN_DEBUG " NR Log Phy Mask Trig IRR Pol" @@ -871,7 +870,6 @@ void __init print_IO_APIC(void) entry = irq_2_pin + entry->next; } printk("\n"); -#endif } printk(KERN_INFO ".................................... done.\n"); diff --git a/xen/include/asm-i386/smpboot.h b/xen/include/asm-i386/smpboot.h index ece215fab0..3ca484d531 100644 --- a/xen/include/asm-i386/smpboot.h +++ b/xen/include/asm-i386/smpboot.h @@ -116,6 +116,15 @@ static inline int target_cpus(void) return cpu_online_map; } #else -#define target_cpus() (0x01) +/* KAF Xen: Round-robin allocate IRQs to CPUs. */ +static inline int target_cpus(void) +{ + static unsigned int cpu_field = 1; + do { + cpu_field <<= 1; + if ( cpu_field == 0x100 ) cpu_field = 1; /* logical field == 8 bits */ + } while ( (cpu_field & cpu_online_map) == 0 ); + return cpu_field; +} #endif #endif -- 2.30.2